import { createRouter, createWebHashHistory } from 'vue-router'

import Home from '@/views/Home.vue';
import DefinitionList from '@/views/DefinitionList.vue';
import Definition from '@/views/Definition.vue';
import InstanceList from '@/views/InstanceList.vue';
import TaskList from '@/views/TaskList.vue';

const routes = [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
        redirect: '/definitionList',
        children: [
            {
                path: '/definitionList',
                name: 'DefinitionList',
                component: DefinitionList,
            },
            {
                path: '/definition',
                name: 'Definition',
                component: Definition,
            },
            {
                path: '/instanceList',
                name: 'InstanceList',
                component: InstanceList,
            },
            {
                path: '/taskList',
                name: 'TaskList',
                component: TaskList,
            },
        ]
    },
    {
        path: '/:pathMatch(.*)',
        name: 'Error',
        component: Error,
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router